package com.budwk.app.sqfwV2.enums.centuryCityOldCare;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * @author ZY.Wang
 * @since 2024/6/7
 */
@Getter
@AllArgsConstructor
public enum CenturyCityOldCareV2FileEnums {
    elderlyCareInsSafetyCheckPdf("1", "养老机构安全生产检查表", "sqfwV2/centuryCityOldCare/elderlyCareInsSafetyCheck.docx", "docx", "养老机构安全生产检查表", "/template/oldCare/养老机构安全生产检查表.docx", "", "/preview/oldCare/elderlyCareInsSafetyCheck.png"),
    foodSalesDailyInsPdf("2", "食品销售日常巡查表", "sqfwV2/centuryCityOldCare/foodSalesDailyIns.docx", "docx", "食品销售日常巡查表", "/template/oldCare/食品销售日常巡查表.docx", "", "/preview/oldCare/foodSalesDailyIns.png"),
    foodServiceDailyInsPdf("3", "餐饮服务日常巡查表", "sqfwV2/centuryCityOldCare/foodServiceDailyIns.docx", "docx", "餐饮服务日常巡查表", "/template/oldCare/餐饮服务日常巡查表.docx", "", "/preview/oldCare/foodServiceDailyIns.png"),
    foodSafetyInsLedgerExcel("4", "食品安全排查台账", "sqfwV2/centuryCityOldCare/foodSafetyInsLedger.xlsx", "xlsx", "食品安全排查台账", "/template/oldCare/foodSafetyInsLedger.xlsx", "", "/preview/oldCare/food.png"),
    elderlyCareInsSafetyInsLedgerExcel("5", "养老机构安全生产检查台账", "sqfwV2/centuryCityOldCare/elderlyCareInsSafetyInsLedger.xlsx", "xlsx", "养老机构安全生产检查台账", "/template/oldCare/elderlyCareInsSafetyInsLedger.xlsx", "", "/preview/oldCare/oldCare.png"),
    ;

    private final String code;
    private final String name;
    private final String path;
    private final String fileType;
    private final String downloadFileName;
    private final String templatePath;
    private final String mergePdfName;
    private final String previewPath;

    public static String getPath(String code){
        String path = Arrays.asList(CenturyCityOldCareV2FileEnums.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getPath();
        return path;
    }

    public static String getDownloadFileName(String code){
        String downloadFileName = Arrays.asList(CenturyCityOldCareV2FileEnums.values())
                .stream()
                .filter(e -> code .equals(e.getCode()) )
                .collect(Collectors.toList())
                .get(0)
                .getDownloadFileName();
        return downloadFileName;
    }
}
